From 22e2d08efba0e2bd745dc7375df34fa8a23bfbac Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 16 Nov 2007 17:09:53 +0000 Subject: [PATCH] hvm passthru: Uses of XC_PAGE_MASK should be XC_PAGE_SIZE-1. Signed-off-by: Weidong Han --- tools/ioemu/hw/pass-through.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ioemu/hw/pass-through.c b/tools/ioemu/hw/pass-through.c index 07a308e2cc..304ae3add0 100644 --- a/tools/ioemu/hw/pass-through.c +++ b/tools/ioemu/hw/pass-through.c @@ -130,7 +130,7 @@ void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size, ret = xc_domain_memory_mapping(xc_handle, domid, old_ebase >> XC_PAGE_SHIFT, assigned_device->bases[i].access.maddr >> XC_PAGE_SHIFT, - (e_size+XC_PAGE_MASK) >> XC_PAGE_SHIFT, + (e_size+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT, DPCI_REMOVE_MAPPING); if ( ret != 0 ) { @@ -143,7 +143,7 @@ void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size, ret = xc_domain_memory_mapping(xc_handle, domid, assigned_device->bases[i].e_physbase >> XC_PAGE_SHIFT, assigned_device->bases[i].access.maddr >> XC_PAGE_SHIFT, - (e_size+XC_PAGE_MASK) >> XC_PAGE_SHIFT, + (e_size+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT, DPCI_ADD_MAPPING); if ( ret != 0 ) PT_LOG("Error: create new mapping failed!\n"); -- 2.30.2